ObjectPool

StockSharp.Xaml.Charting.Common.Helpers

Represents a pool of objects with a size limit.

实现: IDisposable

构造函数

ObjectPool()

Initializes a new instance of the ObjectPool class.

ObjectPool(int, Func<T, T>)

Initializes a new instance of the ObjectPool class.

属性

AvailableCount : int

Gets the amount of pooled instances

Count : int

Gets the summary amount of created instances

IsEmpty : bool

Gets the value indicating whether current ObjectPool instance is empty.

方法

Dispose()

Disposes of items in the pool that implement IDisposable.

Get() : T

Retrieves an item from the pool.

返回值: The item retrieved from the pool.

Get(Func<T, T>) : T

Retrieves an item from the pool.

返回值: The item retrieved from the pool.

Get(Func<T>) : T

Retrieves an item from the pool.

返回值: The item retrieved from the pool.

Put(T)

Places an item in the pool.

item
The item to place to the pool.